package cn.like;

import cn.dev33.satoken.SaManager;
import cn.hutool.extra.spring.SpringUtil;
import lombok.SneakyThrows;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

import java.net.InetAddress;

@SpringBootApplication
@EnableDiscoveryClient
public class GatewayApplication {

    @SneakyThrows
    public static void main(String[] args) {
        SpringApplication.run(GatewayApplication.class, args);

        final String port = SpringUtil.getProperty("server.port");

        final InetAddress localHost = InetAddress.getLocalHost();

        final String nacosServer = SpringUtil.getProperty("spring.cloud.nacos.discovery.server-addr");
        System.out.println("									===============================================================");
        System.out.println("										api文档页面:http://" + localHost.getHostAddress() + ":" + port + "/doc.html");
        System.out.println("										nacos:http://" + nacosServer + "/nacos/index.html");
        System.out.println("启动成功：Sa-Token配置如下：" + SaManager.getConfig());
    }


}